<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/06/02
// +----------------------------------------------------------------------

namespace app\erp\validate;

use think\Validate;

/**
 * 公共类 验证器 收货地址管理
 * @package app\admin\validate
 * @author shiqiang
 */
class Receiving extends Validate
{
    protected $rule = [
        'user_id'	    =>  'require|number|gt:0',
        'id'		    =>  'require|number|gt:0',
		'user_title'	=>  'require',
		'user_city'		=>  'require',
		'user_address'	=>  'require',
		'user_mobile'	=>  'require',
		'is_common'		=>  'require|number',
    ];

    protected $message  =   [
        'user_id' 		=> 'user_id格式错误',
        'id' 			=> 'id格式错误',
        'user_title' 	=> 'user_title格式错误',
        'user_city' 	=> 'user_city格式错误',
        'user_address' 	=> 'user_address格式错误',
        'user_mobile' 	=> 'user_mobile格式错误',
        'is_common' 	=> 'is_common格式错误',
    ];

    //验证场景
    protected $scene = [
        'receiving_index'=>  [//列表
            'user_id',
        ],
        'receiving_add'=>  [//添加
            'user_id',
            'user_title',
            'user_city',
            'user_address',
            'user_mobile',
            'is_common',
        ],
        'receiving_edit'=>  [//修改
            'user_id',
            'id',
            'user_title',
            'user_city',
            'user_address',
            'user_mobile',
            'is_common',
        ],
        'receiving_delete'=>  [//删除
            'user_id',
            'id',
        ]
    ];
}
